package com.yuexun.dhdoctor.module.Chartered.adapter;

import android.widget.AbsListView;

import com.yuexun.dhdoctor.R;
import com.yuexun.dhdoctor.module.Chartered.bean.CharteredBean;
import com.yuexun.dhdoctor.module.contractmanage.bean.ConTractManageBean;

import org.kymjs.kjframe.widget.AdapterHolder;
import org.kymjs.kjframe.widget.KJAdapter;

import java.util.Collection;

/**
 * Created by Administrator on 2019/1/29 0029.
 */

public class CharteredAdapter extends KJAdapter<CharteredBean> {
    public CharteredAdapter(AbsListView view, Collection<CharteredBean> mDatas, int itemLayoutId) {
        super(view, mDatas, itemLayoutId);
    }

    @Override
    public void convert(AdapterHolder adapterHolder, CharteredBean charteredBean, boolean b) {
        adapterHolder.setText(R.id.tv_name,charteredBean.getUserName());
        if(charteredBean.getSex() == 1)
        {
            adapterHolder.setText(R.id.tv_sex,"男");
        }
        else if(charteredBean.getSex() ==2)
        {
            adapterHolder.setText(R.id.tv_sex,"女");
        }
        else {
            adapterHolder.setText(R.id.tv_sex,"不详");
        }
        adapterHolder.setText(R.id.tv_tel,charteredBean.getPhoneNum());
        adapterHolder.setText(R.id.tv_mail,charteredBean.getEmail());
    }
}
